<?php defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<div id="<?php echo ($this->event->getIdEvent());?>"
	style="float: left; width: 100%; clear: left">
	<?php if(JFactory::getUser()->id ==$this->event->getIdCreator()){
		$color="blue";
		$texto="<i>Eres el creador del evento:</i>";
		$creador=null;
	}else{
		$color="green";
		$texto="<i>Estas suscrito al evento:</i>";
		$creador=$this->event->getIdCreator();
	}?>

	<h3>
		<b style="color:<?php echo($color)?>;">
			<div class=nombreEvento>
			<?php echo $texto ?>
			<?php echo $this->event->getNameEvent();?>
			</div> </b>
	</h3>
	<div class=bloqueFechaHora>
		<div class=bloqueFecha style="float: left; width: 50%; clear: left">
			<b>Fecha:</b>
			<?php echo $this->event->getDate();?>
		</div>
		<div class=bloqueHora style="float: right; width: 50%; clear: right">
			<b>Hora:</b>
			<?php echo $this->event->getHora();?>
		</div>
	</div>


	<div class="datosEvento" style="float: left; width: 100%; display: none">

		<div class=bloqueCategoriaCreador
			style="float: left; width: 100%; clear: left">
			<div class=bloqueCategoria style="float: left; width: 50%; clear: left">
				<b>Categoria:</b>
				<?php echo $this->event->getNameCategory();?>
			</div>
			<?php if($creador){
				echo ("<div class=bloqueCreador style=\"float:right;width:50%;clear:right\">
					<b>Creador:</b> ");
				echo ($this->event->getIdCreator());
				echo ("</div>");
			}?>
		</div>
		<div class=bloqueStatusAreaAdministrativa>
			<div class=bloqueStatus style="float: left; width: 50%; clear: left">
				<b>Status:</b>
				<?php echo $this->event->getStatus();?>
			</div>
			<div class=bloqueAreaAdministrativa
				style="float: right; width: 50%; clear: right">
				<b>Area:</b>
				<?php echo $this->event->getAreaAdmin()->getNameArea();?>
			</div>
		</div>
		<div class=bloqueDescripcion>
			<b>Descripcion:</b>
			<?php echo $this->event->getDescription();?>
		</div>
		<div class=bloqueNumeroVisitas>
			<b>Numero de visitas:</b>
			<?php echo $this->event->getContadorVisitas();?>
		</div>
		<div class=bloqueImagen style="float: left; width: 100%; clear: left">
			<img alt="" src="<?php echo $this->event->getImage()?>">
		</div>
		<div class="edicionEvento" style="float: left; width: 100%; display: none">
			<h3>Editar el evento</h3>
			<form class="form" name="form" action="index.php" method="post" onsubmit="editEvent(validateForm(this));return false;">
				<div class="formNombreCategoria" style="float: left; width: 100%; clear: left">
					<div class="formNombre" style="float: left; width: 50%; margin-top: 15px; margin-bottom: 15px">
						<div style="float: left; width: 100%; clear: left; clear: right">
							<b>Nombre</b>
						</div>
						<div style="float: left; width: 50%">
							<input type="text" id="eventName" name="eventName" />
						</div>
					</div>
					<div class="formCategoria" style="float: right; width: 50%; margin-top: 15px; margin-bottom: 15px">
						<div style="float: left; width: 100%; clear: left; clear: right">
							<b>Categoria</b>
						</div>
						<div style="float: left; width: 50%">
							<select class="eventCategory" name="eventCategory" style="width: 150px">
								<?php

									foreach($this->categories as $category){
								?>
								<option value=<?php echo $category->getIdCategory();?>>
								<?php echo $category->getNameCategory();?>
								</option>
								<?php
								}
								?>
							</select>
						</div>
					</div>
				</div>
				<div class="formFechaHora" style="float: left; width: 100%; clear: left; margin-bottom: 15px">
					<div class="formFecha" style="float: left; width: 50%">
						<div style="float: left; width: 100%; clear: left">
							<b>Fecha</b>
						</div>
						<div style="float: left; width: 50%">
							<input type="text" class="eventDate" name="eventDate" />
						</div>
					</div>
					<div class="formHora" style="float: right; width: 50%">
						<div style="float: left; width: 100%; clear: left; clear: right">
							<b>Hora</b>
						</div>
						<div style="float: left; width: 60%">
							<input type="text" id="eventHour" name="eventHour" />
						</div>
					</div>
				</div>
				<div class="formDescripcion"
					style="float: left; width: 100%; clear: left; margin-top: 15px; margin-bottom: 15px">
					<div style="float: left; width: 20%">
						<b>Descripcion</b>
					</div>
					<div style="float: left; width: 100%">
						<textarea rows="15" id="eventDescrip" name="eventDescrip"
							style="width: 85%; height: 150px"></textarea>
					</div>
				</div>
				<div class="formImagen" style="float: left; width: 100%; clear: left; margin-top: 25px">
					<div style="float: left; width: 20%">
						<b>Imagen (URL)</b>
					</div>
					<div style="float: left; width: 80%">
						<input type="text" id="eventImage" name="eventImage" value="http://" style="width: 81%" />
					</div>
				</div>
				<div class="formSubmit" style="float: left; width: 100%; clear: left; margin-top: 25px">
					<div class="boton" style="margin-right: auto; margin-left: auto; display: block; width: 150px">
						<input type="submit" class="large orange awesome" value="Enviar" />
					</div>
				</div>
				<input id="idEvento" type="hidden" value="<?php echo $this->event->getIdEvent();?>"/>
			</form>
		</div>
		<div class="eliminar" style="float: left">
		<?php if($creador){?>
			<div class="imagen" style="float: left">
				<em title="<?php echo $this->event->getIdEvent();?>"
					title2="<?php echo JFactory::getUser()->id;?>"><a href=""
					class="anularSuscripcion"><img
						src="components/com_actinmap/images/Remove.png"></img> </a> </em>
			</div>
			<div class="texto" style="float: left; margin-top: 5px">
				<b>Anular suscripcion</b>
			</div>
			<?php }else{?>
			<div class="imagenEdit" style="float: left">
				<a href="" class="editarEvento"><img
					src="components/com_actinmap/images/Edit.png"
					style="margin-right: 4px"></img> </a>
			</div>
			<div class="texto2" style="float: left; margin-top: 5px">
				<b>Editar evento</b>
			</div>
			<div class="imagenRemove" style="float: left">
				<em title="<?php echo $this->event->getIdEvent();?>"><a href=""
					class="eliminarEvento"><img
						src="components/com_actinmap/images/Remove.png"></img> </a> </em>
			</div>
			<div class="texto" style="float: left; margin-top: 5px">
				<b>Eliminar evento</b>
			</div>
			<?php 
			}
			?>
		</div>

	</div>

	<div class="moreDiv"
		style="clear: both; float: left; with: 100%; margin-top: 0px;">

		<p class="morePar" style="margin-top: 0px; margin-bottom: 0px;">
			<a href="" class="moreLink"><b>Ver mas datos...</b> </a>
		</p>

	</div>

</div>
